package com.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.man.ShopCarCtrl;
import com.std.ShopCar;

public class UserShopCarUpdateAction implements SessionAware{
	private int 	amount;
	private int		bookId;
	private Map		sessionMap;
	public int getAmount() {
		return amount;
	}
	public void setAmount(int amount) {
		this.amount = amount;
	}
	public int getBookId() {
		return bookId;
	}
	public void setBookId(int bookId) {
		this.bookId = bookId;
	}
	public void setSession(Map<String, Object> session) {
		// TODO Auto-generated method stub
		sessionMap=session;
	}
	public String execute() {
		if(sessionMap.get("shopCarList")!=null){
			List<ShopCar> shopCarList=(List<ShopCar>) sessionMap.get("shopCarList");
			ShopCarCtrl.updateItem(shopCarList, bookId, amount);
		}
		return "success";
	}
}
